package nero.yncc.com.createart.activity;

import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.v7.widget.LinearLayoutManager;
import android.widget.LinearLayout;
import android.widget.TextView;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;

import nero.yncc.com.createart.R;
import nero.yncc.com.createart.base.BaseActivity;
import nero.yncc.com.createart.utils.TextUtil;

/**
 * Created by nero on 17-6-30.
 */

@ContentView(R.layout.activity_about)
public class ActivityAbout extends BaseActivity {

    @ViewInject(R.id.tv_version)
    TextView tv_version;   //版本号
    @ViewInject(R.id.ll_about)
    LinearLayout ll_about;   //关于缕墨
    @ViewInject(R.id.ll_say)
    LinearLayout ll_say;   //意见反馈

    @Override
    protected void initView() {
        super.initView();
        getVersion();
        setTitleBarTitle("关于");
    }

    private void getVersion(){
        try {
            String code=this.getPackageManager().getPackageInfo(this.getPackageName(),0).versionName;
            tv_version.setText(TextUtil.getText(code,"v1.0"));
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
//        PackageManager packageManager=new
    }

    @Override
    protected void initListener() {
        super.initListener();
        ll_about.setOnClickListener(this);
        ll_say.setOnClickListener(this);
    }

    @Override
    protected void doClick(int id) {
        super.doClick(id);
        switch (id){
            case R.id.ll_about:
                startActivity(new Intent(mContext,ActivityAboutIn.class));
                break;
            case R.id.ll_say:
                startActivity(new Intent(mContext,ActivityYijian.class));
                break;
        }
    }
}
